inherited frmConsultaTitulos: TfrmConsultaTitulos
  Left = 274
  Top = 103
  Width = 1024
  Height = 513
  Caption = 'Consulta de Titulos'
  OldCreateOrder = True
  OnClose = FormClose
  PixelsPerInch = 96
  TextHeight = 13
  inherited lblNomeForm: TsLabelFX
    Top = 445
    Width = 1016
    Height = 41
  end
  inherited tbrBotoes: TsToolBar
    Width = 1016
    inherited spbAlterar: TsSpeedButton
      Visible = False
    end
    inherited spbExcluir: TsSpeedButton
      Visible = False
    end
    inherited spbVoltar: TsSpeedButton
      Visible = False
    end
  end
  object sPanel1: TsPanel [2]
    Left = 0
    Top = 65
    Width = 1016
    Height = 380
    Align = alClient
    TabOrder = 1
    SkinData.SkinSection = 'PANEL'
    object sPanel2: TsPanel
      Left = 1
      Top = 1
      Width = 1014
      Height = 80
      Align = alTop
      TabOrder = 0
      SkinData.SkinSection = 'PANEL'
      object sLabel1: TsLabel
        Left = 94
        Top = 12
        Width = 56
        Height = 13
        Caption = 'Favorecido:'
        ParentFont = False
        Font.Charset = DEFAULT_CHARSET
        Font.Color = 2171169
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
      end
      object sLabel2: TsLabel
        Left = 94
        Top = 43
        Width = 59
        Height = 13
        Caption = 'Vencimento:'
        ParentFont = False
        Font.Charset = DEFAULT_CHARSET
        Font.Color = 2171169
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
      end
      object sLabel3: TsLabel
        Left = 255
        Top = 43
        Width = 60
        Height = 13
        Caption = 'Nr. Contrato:'
        ParentFont = False
        Font.Charset = DEFAULT_CHARSET
        Font.Color = 2171169
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
      end
      object rdgConsultaTitulos: TRadioGroup
        Left = 8
        Top = 8
        Width = 81
        Height = 65
        Caption = 'Tipo'
        Items.Strings = (
          'Pagar'
          'Receber'
          'Ambos')
        TabOrder = 0
        OnClick = rdgConsultaTitulosClick
      end
      object cedFavorecido: TsCurrencyEdit
        Left = 155
        Top = 8
        Width = 80
        Height = 21
        AutoSize = False
        Color = clWhite
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clBlack
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        ParentFont = False
        TabOrder = 1
        BoundLabel.Indent = 0
        BoundLabel.Font.Charset = DEFAULT_CHARSET
        BoundLabel.Font.Color = clWindowText
        BoundLabel.Font.Height = -11
        BoundLabel.Font.Name = 'MS Sans Serif'
        BoundLabel.Font.Style = []
        BoundLabel.Layout = sclLeft
        BoundLabel.MaxWidth = 0
        BoundLabel.UseSkinColor = True
        SkinData.SkinSection = 'EDIT'
        GlyphMode.Blend = 0
        GlyphMode.Grayed = False
        DisplayFormat = '#######0'
      end
      object dblFavorecido: TsDBLookupComboBox
        Left = 235
        Top = 8
        Width = 286
        Height = 21
        Color = clWhite
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clBlack
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        KeyField = 'CODIGO_EMITENTE'
        ListField = 'RAZAO_SOCIAL'
        ListSource = dtsFavorecido
        ParentFont = False
        TabOrder = 2
        OnCloseUp = dblFavorecidoCloseUp
        OnExit = dblFavorecidoExit
        BoundLabel.Indent = 0
        BoundLabel.Font.Charset = DEFAULT_CHARSET
        BoundLabel.Font.Color = clWindowText
        BoundLabel.Font.Height = -11
        BoundLabel.Font.Name = 'MS Sans Serif'
        BoundLabel.Font.Style = []
        BoundLabel.Layout = sclLeft
        BoundLabel.MaxWidth = 0
        BoundLabel.UseSkinColor = True
        SkinData.SkinSection = 'COMBOBOX'
      end
      object dedVencimentoTitulo: TsDateEdit
        Left = 155
        Top = 39
        Width = 94
        Height = 21
        AutoSize = False
        Color = clWhite
        EditMask = '!99/99/9999;1; '
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clBlack
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        MaxLength = 10
        ParentFont = False
        TabOrder = 3
        Text = '  /  /    '
        BoundLabel.Indent = 0
        BoundLabel.Font.Charset = DEFAULT_CHARSET
        BoundLabel.Font.Color = clWindowText
        BoundLabel.Font.Height = -11
        BoundLabel.Font.Name = 'MS Sans Serif'
        BoundLabel.Font.Style = []
        BoundLabel.Layout = sclLeft
        BoundLabel.MaxWidth = 0
        BoundLabel.UseSkinColor = True
        SkinData.SkinSection = 'EDIT'
        GlyphMode.Blend = 0
        GlyphMode.Grayed = False
      end
      object edtNrContrato: TsEdit
        Left = 317
        Top = 39
        Width = 204
        Height = 21
        Color = clWhite
        Font.Charset = DEFAULT_CHARSET
        Font.Color = clBlack
        Font.Height = -11
        Font.Name = 'MS Sans Serif'
        Font.Style = []
        ParentFont = False
        TabOrder = 4
        SkinData.SkinSection = 'EDIT'
        BoundLabel.Indent = 0
        BoundLabel.Font.Charset = DEFAULT_CHARSET
        BoundLabel.Font.Color = clWindowText
        BoundLabel.Font.Height = -11
        BoundLabel.Font.Name = 'MS Sans Serif'
        BoundLabel.Font.Style = []
        BoundLabel.Layout = sclLeft
        BoundLabel.MaxWidth = 0
        BoundLabel.UseSkinColor = True
      end
      object chkQuitados: TsCheckBox
        Left = 528
        Top = 40
        Width = 70
        Height = 19
        Caption = 'Quitados'
        TabOrder = 5
        SkinData.SkinSection = 'CHECKBOX'
        ImgChecked = 0
        ImgUnchecked = 0
      end
    end
    object dbgConsultaTitulos: TRxDBGrid
      Left = 1
      Top = 81
      Width = 1014
      Height = 298
      Align = alClient
      DataSource = dtsConsultaTitulos
      Options = [dgTitles, dgIndicator, dgColumnResize, dgColLines, dgRowLines, dgRowSelect, dgConfirmDelete, dgCancelOnExit]
      PopupMenu = popConsultaTitulos
      TabOrder = 1
      TitleFont.Charset = DEFAULT_CHARSET
      TitleFont.Color = clWindowText
      TitleFont.Height = -11
      TitleFont.Name = 'MS Sans Serif'
      TitleFont.Style = []
      OnDrawColumnCell = dbgConsultaTitulosDrawColumnCell
      Columns = <
        item
          Expanded = False
          FieldName = 'TIPO_LANCAMENTO'
          Title.Caption = 'Tipo'
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'NR_REG_LANCAMENTO'
          Title.Caption = 'Nr Titulo'
          Width = 63
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'NR_PARCELA'
          Title.Caption = 'Parcela'
          Width = 60
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'DT_VENCIMENTO'
          Title.Caption = 'Vencimento'
          Width = 70
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'FAVORECIDO'
          Title.Caption = 'Favorecido'
          Width = 300
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'QUITADO_SN'
          Title.Caption = 'Quitado'
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'DT_QUITACAO'
          Title.Caption = 'Dt. Quita'#231#227'o'
          Width = 70
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'VALOR_TOTAL_PARCELA'
          Title.Caption = 'Valor Parcela'
          Width = 80
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'VALOR_DESCONTO'
          Title.Caption = 'Valor Desconto'
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'VALOR_ACRESCIMO'
          Title.Caption = 'Valor Acrescimo'
          Visible = True
        end
        item
          Expanded = False
          FieldName = 'VALOR_TITULO'
          Title.Caption = 'Vl Total Titulo'
          Width = 80
          Visible = True
        end>
    end
  end
  object qryConsultaTitulos: TADOQuery
    Connection = frmPrincipal.cnn
    Parameters = <>
    SQL.Strings = (
      'SELECT LF.TIPO_LANCAMENTO,'
      '       LFI.NR_REG_LANCAMENTO,'
      '       LFI.NR_PARCELA,'
      '       LFI.DT_VENCIMENTO,'
      '       CASE'
      '          WHEN LFI.DT_VENCIMENTO < GETDATE ()'
      '          THEN'
      '             DATEDIFF (DAY, LFI.DT_VENCIMENTO, GETDATE ())'
      '          ELSE'
      '             0'
      '       END'
      '          AS DIAS_ATRASO,'
      '       EMI.RAZAO_SOCIAL FAVORECIDO,'
      '       LFI.VALOR_TOTAL VALOR_TOTAL_PARCELA,'
      '       LF.VALOR VALOR_TITULO,'
      '       CON.NRO_CONTRATO, VALOR_ACRESCIMO, VALOR_DESCONTO,'
      #9'LFI.QUITADO_SN, ISNULL(LFI.DT_QUITACAO,NULL) DT_QUITACAO'
      '  FROM LANCAMENTO_FINANCEIRO LF,'
      '       LANCAMENTO_FINANCEIRO_ITEM LFI,'
      '       EMITENTE EMI,'
      '       CONTRATO CON'
      ' WHERE     LF.NR_REG = LFI.NR_REG_LANCAMENTO'
      '       AND LF.CODIGO_EMITENTE = EMI.CODIGO_EMITENTE'
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      'ORDER BY 1, 2, 3, LFI.DT_VENCIMENTO'
      ' ')
    Left = 200
    Top = 289
    object qryConsultaTitulosTIPO_LANCAMENTO: TStringField
      FieldName = 'TIPO_LANCAMENTO'
      Size = 10
    end
    object qryConsultaTitulosNR_REG_LANCAMENTO: TIntegerField
      FieldName = 'NR_REG_LANCAMENTO'
    end
    object qryConsultaTitulosNR_PARCELA: TIntegerField
      FieldName = 'NR_PARCELA'
    end
    object qryConsultaTitulosDT_VENCIMENTO: TDateTimeField
      FieldName = 'DT_VENCIMENTO'
      DisplayFormat = 'dd/mm/yyyy'
    end
    object qryConsultaTitulosFAVORECIDO: TStringField
      FieldName = 'FAVORECIDO'
      Size = 300
    end
    object qryConsultaTitulosVALOR_TOTAL_PARCELA: TFloatField
      FieldName = 'VALOR_TOTAL_PARCELA'
      DisplayFormat = '#,###,###,##0.00'
    end
    object qryConsultaTitulosVALOR_TITULO: TFloatField
      FieldName = 'VALOR_TITULO'
      DisplayFormat = '#,###,###,##0.00'
    end
    object qryConsultaTitulosQUITADO_SN: TStringField
      FieldName = 'QUITADO_SN'
      Size = 1
    end
    object qryConsultaTitulosDT_QUITACAO: TDateTimeField
      FieldName = 'DT_QUITACAO'
    end
    object qryConsultaTitulosVALOR_ACRESCIMO: TFloatField
      FieldName = 'VALOR_ACRESCIMO'
      DisplayFormat = '#,###,###,##0.00'
    end
    object qryConsultaTitulosVALOR_DESCONTO: TFloatField
      FieldName = 'VALOR_DESCONTO'
      DisplayFormat = '#,###,###,##0.00'
    end
  end
  object dtsConsultaTitulos: TDataSource
    DataSet = rxConsultaTitulos
    Left = 176
    Top = 233
  end
  object popConsultaTitulos: TPopupMenu
    Left = 368
    Top = 193
    object QuitarTtulo1: TMenuItem
      Caption = 'Quitar T'#237'tulo'
      OnClick = QuitarTtulo1Click
    end
    object EstornarQuitao1: TMenuItem
      Caption = 'Estornar Quita'#231#227'o'
      OnClick = EstornarQuitao1Click
    end
  end
  object qryFavorecido: TADOQuery
    Connection = frmPrincipal.cnn
    Parameters = <>
    SQL.Strings = (
      'SELECT A.CODIGO_EMITENTE, A.RAZAO_SOCIAL FROM EMITENTE A'
      'WHERE A.ATIVO_SN = '#39'S'#39
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      ''
      'ORDER BY A.RAZAO_SOCIAL')
    Left = 529
    Top = 74
  end
  object dtsFavorecido: TDataSource
    DataSet = qryFavorecido
    Left = 561
    Top = 74
  end
  object rxConsultaTitulos: TRxMemoryData
    FieldDefs = <>
    Left = 144
    Top = 233
    object rxConsultaTitulosTIPO_LANCAMENTO: TStringField
      FieldName = 'TIPO_LANCAMENTO'
      Size = 10
    end
    object rxConsultaTitulosNR_REG_LANCAMENTO: TIntegerField
      FieldName = 'NR_REG_LANCAMENTO'
    end
    object rxConsultaTitulosNR_PARCELA: TIntegerField
      FieldName = 'NR_PARCELA'
    end
    object rxConsultaTitulosDT_VENCIMENTO: TDateTimeField
      FieldName = 'DT_VENCIMENTO'
      DisplayFormat = 'dd/mm/yyyy'
    end
    object rxConsultaTitulosFAVORECIDO: TStringField
      FieldName = 'FAVORECIDO'
      Size = 300
    end
    object rxConsultaTitulosVALOR_TOTAL_PARCELA: TFloatField
      FieldName = 'VALOR_TOTAL_PARCELA'
      DisplayFormat = '#,###,###,##0.00'
    end
    object rxConsultaTitulosVALOR_TITULO: TFloatField
      FieldName = 'VALOR_TITULO'
      DisplayFormat = '#,###,###,##0.00'
    end
    object rxConsultaTitulosQUITADO_SN: TStringField
      FieldName = 'QUITADO_SN'
      Size = 1
    end
    object rxConsultaTitulosDT_QUITACAO: TDateTimeField
      FieldName = 'DT_QUITACAO'
    end
    object rxConsultaTitulosVALOR_DESCONTO: TFloatField
      FieldName = 'VALOR_DESCONTO'
      DisplayFormat = '#,###,###,##0.00'
    end
    object rxConsultaTitulosVALOR_ACRESCIMO: TFloatField
      FieldName = 'VALOR_ACRESCIMO'
      DisplayFormat = '#,###,###,##0.00'
    end
  end
  object qryAlteraParcelaTitulo: TADOQuery
    Connection = frmPrincipal.cnn
    Parameters = <
      item
        Name = 'QUITADO_SN'
        DataType = ftString
        NumericScale = 255
        Precision = 255
        Size = 1
        Value = Null
      end
      item
        Name = 'DT_QUITACAO'
        Attributes = [paNullable]
        DataType = ftDateTime
        NumericScale = 3
        Precision = 23
        Size = 16
        Value = Null
      end
      item
        Name = 'NR_REG_LANCAMENTO'
        Attributes = [paSigned]
        DataType = ftInteger
        Precision = 10
        Size = 4
        Value = Null
      end
      item
        Name = 'NR_PARCELA'
        Attributes = [paSigned]
        DataType = ftInteger
        Precision = 10
        Size = 4
        Value = Null
      end>
    SQL.Strings = (
      'UPDATE LANCAMENTO_FINANCEIRO_ITEM'
      'SET QUITADO_SN = :QUITADO_SN,'
      '    DT_QUITACAO = :DT_QUITACAO'
      'WHERE NR_REG_LANCAMENTO = :NR_REG_LANCAMENTO'
      '  AND NR_PARCELA = :NR_PARCELA')
    Left = 136
    Top = 449
  end
  object qryQuitacao: TADOQuery
    Connection = frmPrincipal.cnn
    Parameters = <
      item
        Name = 'VALOR'
        Attributes = [paSigned, paNullable]
        DataType = ftFloat
        NumericScale = 255
        Precision = 15
        Size = 8
        Value = Null
      end
      item
        Name = 'VALOR'
        Attributes = [paSigned, paNullable]
        DataType = ftFloat
        NumericScale = 255
        Precision = 15
        Size = 8
        Value = Null
      end
      item
        Name = 'NR_REG'
        Attributes = [paSigned]
        DataType = ftInteger
        Precision = 10
        Size = 4
        Value = Null
      end>
    SQL.Strings = (
      'UPDATE LANCAMENTO_FINANCEIRO'
      '  SET VALOR_QUITACAO = isnull(VALOR_QUITACAO,0) + :VALOR,'
      '      SALDO_TITULO = isnull(SALDO_TITULO,0) - :VALOR'
      ' WHERE NR_REG = :NR_REG')
    Left = 176
    Top = 448
  end
  object qryEstorno: TADOQuery
    Connection = frmPrincipal.cnn
    Parameters = <
      item
        Name = 'VALOR'
        Attributes = [paSigned, paNullable]
        DataType = ftFloat
        NumericScale = 255
        Precision = 15
        Size = 8
        Value = Null
      end
      item
        Name = 'VALOR'
        Attributes = [paSigned, paNullable]
        DataType = ftFloat
        NumericScale = 255
        Precision = 15
        Size = 8
        Value = Null
      end
      item
        Name = 'NR_REG'
        Attributes = [paSigned]
        DataType = ftInteger
        Precision = 10
        Size = 4
        Value = Null
      end>
    SQL.Strings = (
      'UPDATE LANCAMENTO_FINANCEIRO'
      '  SET VALOR_QUITACAO = isnull(VALOR_QUITACAO,0) - :VALOR,'
      '      SALDO_TITULO = isnull(SALDO_TITULO,0) + :VALOR'
      ' WHERE NR_REG = :NR_REG')
    Left = 208
    Top = 448
  end
end
